package cn.com.ebidding.business.enums;

public enum ArticleAuthEnum {
    EDIT(1,"编辑"),VIEW(2,"查看");

    private Integer code;
    private String desc;

    ArticleAuthEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ArticleAuthEnum get(Integer code) {
        if (null == code) {
            return VIEW;
        }
        ArticleAuthEnum[] enums = ArticleAuthEnum.values();
        for (ArticleAuthEnum anEnum : enums) {
            if (anEnum.getCode().equals(code)) {
                return anEnum;
            }
        }
        return VIEW;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
